--
-- Add build recipe for the gate controller
--
-- (Also added textures to override default ones)
local gates_nodename = 'gates:controler'
if minetest.registered_items[gates_nodename]
  and minetest.settings:get_bool('gates_enable_craft', true)
  then

	local item_pwr="default:mese_crystal"
	local item_gear="default:tin_ingot"
	local item_stone="default:stone_block"
	local item_stick="default:stick"

	if minetest.get_modpath("basic_materials") then
    item_gear="basic_materials:gear_steel"
	elseif minetest.get_modpath("pipeworks") then
		item_gear="pipeworks:gear"
	end
	
	if minetest.get_modpath("mesecons_walllever") then
		item_pwr="group:mesecon_conductor_craftable"
		local item_lever = "mesecons_walllever:wall_lever_off"
		minetest.register_craft({
			type = "shapeless",
			output = gates_nodename,
			recipe = { item_stone, item_lever },
		})
	end


	minetest.register_craft({
		output = gates_nodename..' 2',
		recipe = {
				{ item_stone, item_stick, item_stone },
				{ item_gear, item_pwr, item_gear },
				{ item_stone, item_stick, item_stone }
		}
	})
  
end
